home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CMIDI 2.2 / CMIDIClient.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  2.0 KB  |  70 lines  |  [TEXT/KAHL]

  1. /*
  2.  *——— CMIDIClient.h ——————————————————————————————————————————————————————————
  3.  * Copyright © Paul Ferguson, 1990-94.  All rights reserved.
  4.  *
  5.  * For use with Symantec C++ 6.0 and the THINK Class Library.
  6.  *
  7.  * Description:
  8.  *    This class defines a MIDI Manager client object.  Every application that
  9.  *    creates CMIDI objects must first create a CMIDIClient object, gMIDIClient
  10.  *    (defined in CMIDIClient.c).  You should not create any additional
  11.  *    CMIDIClient objects.
  12.  *
  13.  *    Refer to the CMIDI Programmer's Manual for a complete desciption of
  14.  *    this class.
  15.  *————————————————————————————————————————————————————————————————————————————
  16.  */
  17. #pragma once
  18. #include <CObject.h>
  19. #include <MIDI.h>                // ••• !!! DANGER, WILL ROBINSON !!! •••
  20.                                 // You must use 2.0 version of MIDI.h, not the
  21.                                 // one included with THINK C 5.0 (ver 1.2).
  22.                                 // Otherwise, you will get compile and link errors.
  23.  
  24. #define ErrNoMIDI    -249        // MIDI MANAGER DRIVER NOT PRESENT. (It happens more
  25.                                 // often than you think…)  Minus 249 is one more than
  26.                                 // the first real MIDI Manager error code, and does
  27.                                 // not appear to be used presently.
  28.  
  29. extern OSType gSignature;
  30.  
  31. class CMIDIClient : public CObject
  32. {
  33.  
  34. public:
  35.  
  36.     OSErr            IMIDIClient(short theIconID);
  37.     virtual    void    Dispose(void);
  38. #ifdef __cplusplus
  39.     MIDIIDListHdl    GetPorts(void)
  40.                     {
  41.                         return ((midiMgrVerNum) ? MIDIGetPorts(gSignature) : (MIDIIDListHdl) 0);
  42.                     };
  43.     Boolean            WorldChanged(void)
  44.                     {
  45.                         return ( (midiMgrVerNum) ? MIDIWorldChanged(gSignature) : FALSE );
  46.                     };
  47.     unsigned long    GetVerNum(void)
  48.                     {
  49.                         return midiMgrVerNum;
  50.                     };
  51.     unsigned short    GetShortVerNum(void)
  52.                     {
  53.                         return shortMidiMgrVerNum;
  54.                     };
  55. #else
  56.     MIDIIDListHdl    GetPorts(void);
  57.     Boolean            WorldChanged(void);
  58.     unsigned long    GetVerNum(void);
  59.     unsigned short    GetShortVerNum(void);
  60. #endif
  61.  
  62. private:
  63.  
  64.     unsigned long    midiMgrVerNum;        // Version number.  Also used to
  65.                                         // determine whether signed in (if non-zero)
  66.     unsigned short    shortMidiMgrVerNum;
  67. };
  68.  
  69. // end of CMIDIClient.h
  70.